#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>
#include <time.h>

#define N 200

int main(void) {
    char message[N] = { 0 }, ch;
    int i = 0;

    printf("Enter message: ");
    while ((ch = getchar()) != '\n' && i < N)
    {
        message[i++] = ch;
    }
    
    printf("In BIFF-speak: ");
    for (i = 0; i < N; i++)
    {
        if (message[i]) {
            ch = toupper(message[i]);
            switch (ch)
            {
            case 'A':
                ch = '4';
                break;
            case 'B':
                ch = '8';
                break;
            case 'E':
                ch = '3';
                break;
            case 'I':
                ch = '1';
                break;
            case 'O':
                ch = '0';
                break;
            case 'S':
                ch = '5';
                break;
            default:
                break;
            }
            putchar(ch);
        }
        else {
            break;
        }
    }

    srand((unsigned) time(NULL));
    for (i = 0; i < rand() % 4 + 8; i++)
    {
        putchar('!');
    }
    putchar('\n');

    return 0;
}
